<template>
  <div class="main device-left-container">
    <header class="header-container">
      <div class="title">
        <span>电力设备监控</span>
      </div>
    </header>
    <div class="chart-box">
      <div class="chart" :style="'height:' + rowHeight* 4 + 'px'">
        <Statistic></Statistic>
      </div>
      <div class="chart" :style="'height:' + rowHeight* 4 + 'px'">
        <Left2></Left2>
      </div>
      <div class="chart" :style="'height:' + rowHeight* 4 + 'px'">
        <Left3></Left3>
      </div>
    </div>
  </div>
</template>

<script>
import Statistic from './Statistic'
import Left2 from './Left2'
import Left3 from './Left3'

const layout = [
  {x: 0, y: 0, w: 24, h: 4, i: '1', component: 'Statistic'},
  {x: 0, y: 0, w: 24, h: 4, i: '2', component: 'Statistic'},
  {x: 0, y: 0, w: 24, h: 4, i: '3', component: 'Statistic'}
]

export default {
  name: 'DeviceLeft',

  components: {
    Statistic,
    Left2,
    Left3
  },

  data () {
    return {
      layout: layout,
      rowHeight: 100,
      show: false
    }
  },

  mounted () {
    this.$nextTick(() => {
      let containerHeight = this.$el.clientHeight - 90
      this.rowHeight = (containerHeight) / 12
      setTimeout(() => {
        this.show = true
      }, 0)
    })
  },

  methods: {
    onResize () {
      console.log(1231)
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '../../../../assets/stylus/base'

.device-left-container {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  font-size: 14px;
  overflow: hidden;

  .header-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    font-size: 24px;
    padding-left: 10px;
  }

  .chart-box {
    width: 100%;
    height: 100%;
    padding-top: 50px;
    box-sizing: border-box;

    .chart {
      margin-top: 10px;
      background: red;
    }
  }
}
</style>
